//------------Sonic CD Small Platform Script-------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

//-------Aliases-------//
#alias 43: TYPE_SMALLPLATFORM


sub ObjectMain
	if Object.Value0==1
		if Object.Value1<16
			Object.Value1++
			TempValue0=Object.Value1
			TempValue0&=3
			if TempValue0==3
				Object.Value2=65536
			else
				Object.Value2=0
			endif
		else
			Object.Value2=0
		endif
	else
		if Object.Value1>0
			Object.Value1--
			TempValue0=Object.Value1
			TempValue0&=3
			if TempValue0==3
				Object.Value2=-65536
			else
				Object.Value2=0
			endif
		else
			Object.Value2=0
		endif
	endif
	Object.Value0=0
endsub


sub ObjectPlayerInteraction
	PlayerObjectCollision(C_PLATFORM,-16,-9,16,12)
	if CheckResult==1
		Object.Value0=1
		Player.YPos+=Object.Value2
	endif
endsub


sub ObjectDraw
	Object.YPos+=Object.Value2
	DrawSprite(0)
endsub


sub ObjectStartup
	LoadSpriteSheet("R1/Objects.gif")
	SpriteFrame(-16,-16,32,32,190,101)
endsub

sub RSDK
	LoadSpriteSheet("Global/Display.gif")
	SetEditorIcon(Icon0,SingleIcon,-16,-16,32,32,1,143)
endsub
